import java.util.Scanner;

public class T9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("leg:");
        int leg = scanner.nextInt();
        System.out.println("head:");
        int head = scanner.nextInt();
        int a = head*2-leg/2;
        int b = head-a;
        if(leg%2!=0||a<0||b<0)
        {
            System.out.println("input error.");
        }
        else
        {
            System.out.println("chick="+a+",hare="+b);
        }
    }
}
